'''
Created on 06/ago/2012

@author: esgrano
'''
from host import host
import time

PATH_SEPARATOR        = "/"

NAGIOS_OK = 0
NAGIOS_WARNING = 1
NAGIOS_CRITICAL = 2
NAGIOS_UNKNOWN = 3

def delay(second):
    for i in range(1,int(second)):
        time.sleep(1)
        
        
def sendSMS(smscommand, hostname, description,contacts):
    ##try:
        for contatto in contacts:
            if contatto.isEnabled():
                arg1='"' + hostname + ' ' + description + ' is CRITICAL"'
                arg2=contatto.getPager()
                print ("SMS : " + smscommand + " " + arg1 + " " + arg2)
                #r=call([smsCommand,arg1,arg2],stdout=None,stderr=None)
    #except:
    #    raise Exception("Error sending sms")
     